<?php session_start();
    include_once ("entity/Constantes.php");
        if(empty($_SESSION[Constantes::K_SESSION_LOGIN_USUARIO])){
            header('Location: login.php');
            exit();
        }
?>
<!DOCTYPE html>
<html lang="es">
    <head>
        <meta charset="uft-8"/>
        <title>SAI - Sistema de Atenci&#243n de Incidencias</title>
        <link rel="shortcut icon" href="images/logo/indecopi.ico" type="image/x-icon"/>
        <link rel="stylesheet" href="css/SGSI.css">
        
        <link rel="stylesheet" href="extensions/jquery-ui-1.10.4/css/custom-theme/jquery-ui-1.10.4.custom.css">    
        <script src="extensions/jquery-ui-1.10.4/js/jquery-1.10.2.js"></script>
        <script src="extensions/jquery-ui-1.10.4/js/jquery-ui-1.10.4.custom.js"></script>
        
        <link href="extensions/jqGrid-4.5.4/css/ui.jqgrid.css" rel="stylesheet" />
        <script src="extensions/jqGrid-4.5.4/js/i18n/grid.locale-es.js"></script>
        <script src="extensions/jqGrid-4.5.4/js/jquery.jqGrid.min.js"></script>
        
        <script type='text/javascript' src='js/menu_jquery.js'></script>
        <script src="js/dropdownlist.js"></script>
        <script src="js/generales.js"></script>
        
    </head>
    <body>
        <div id="centrado">
            <div id="headerText">
                &nbsp;&nbsp;<img src="images/logo/indecopi.png" width="250" height="90"/>
            </div>
            <div id="textoCabecera">
                <table border="0">
                    <tr>
                        <td align="right"><font face='courier' size='2'>
                            <?php
                                if(!empty($_SESSION[Constantes::K_SESSION_LOGIN_USUARIO])){
                                    echo strtoupper($_SESSION[Constantes::K_SESSION_LOGIN_USUARIO]);
                                }
                            ?></font>
                        </td>
                        <td rowspan="2">
                            <img src="images/botones/user2.png" width="50" height='50'/>
                        </td>
                    </tr>
                    <tr>
                        <td align="right"><font face='courier' size='2'>
                            <?Php
                                if(!empty($_SESSION[Constantes::K_SESSION_CARGO_USUARIO])){
                                    echo strtoupper($_SESSION[Constantes::K_SESSION_CARGO_USUARIO]);
                                }
                            ?></font>
                        </td>
                    </tr>
                    <tr>
                        <td colspan='2' align='right'>
                            <a id='cr' href='logout.php'>Cerrar Sesion</a>
                        </td>
                    </tr>
                </table>
            </div><br/><br/>
            <div id="baner"><br/>&nbsp;&nbsp;&nbsp;
                <?Php
                    $diasInit = array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado");
                    $mesesInit = array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
                    
                    $fecha = "Lima, ".date('d')." de ".$mesesInit[date('n')-1]. " del ".date('Y') ;
                    echo $fecha;
//                    print "Lima, ".date("d")." de ".date("F")." de ".date("Y")
                ?>
            </div>
            <div>
                <div id="divSvg">
                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" preserveAspectRatio="none">
                        <path  fill="none" stroke="#821010" stroke-width=".5" opacity=".6" d=" M-32 4 C-24 4 -24 28 -16 28 C-8 28 -8 4 0 4 C8 4 8 28 16 28 C24 28 24 8 32 8 ">
                            <animateTransform attributeName="transform" type="translate" values=" 0 0; 32 0 " dur="100s" repeatCount="indefinite" />
                        </path>
                        <path  fill="none" stroke="#821010" stroke-width=".5" opacity=".4" d=" M-32 12 C-24 12 -24 20 -16 20 C-8 20 -8 12 0 12 C8 12 8 20 16 20 C24 20 24 12 32 12 ">
                            <animateTransform attributeName="transform" type="translate" values=" 0 0; 32 0 " dur="100s" repeatCount="indefinite" />
                        </path>
                        <path  fill="none" stroke="#821010" stroke-width=".5" opacity=".8" d=" M-32 8 C-24 8 -24 24 -16 24 C-8 24 -8 8 0 8 C8 8 8 24 16 24 C24 24 24 8 32 8 ">
                            <animateTransform attributeName="transform" type="translate" values=" 0 0; 32 0 " dur="100s" repeatCount="indefinite" />
                        </path>
                    </svg>
                </div>
                <div id="divMenu">
                    <div id='cssmenu'>
                        <?
                                        include_once ('views/menuView.php');
                        ?>
                    </div>
                </div>
            </div>
            
        </div>
        <div id="contenido">
            <section id="izquierda">
                    <?php
                        if (file_exists("bussiness/MenuBR.php")) {
                            include_once("bussiness/MenuBR.php");
                        }
                        if(isset($_GET["set"])){
                            if($_GET["set"]=="99"){
                                require ('default.php');
                            }else{
                                $idOpcion = $_GET["set"];
                                $brOpcion = new MenuBR();
                                $dato = $brOpcion->opcionXCodigo($idOpcion);
                            
                                if(file_exists($dato->ruta)){
                                    require ($dato->ruta);
                                }
                            }
                        }else{
                            require ("views/Ticket/RegistroTicket.php");
                        }
//                        switch($_GET["set"]){
//                            case '1': require("views/pages/AnularView.php");
//                                break;
//                            case '2': require ("views/pages/RevertirView.php");
//                                break;
//                            case '3': require ("views/pages/ActivarView.php");
//                                break;
//                            case '4': require ("views/Ticket/ConsultaActividadView.php");
//                                break;
//                            case '5': require ("views/pages/ConsultaCumView.php");
//                                break;
//                            case '6': require ("views/pages/ConsultaDetalleCumView.php");
//                                break;
//                            case '7': require ("views/report/ReporteTicketView.php");
//                                break;
//                            case '99':require ('default.php');
//                                break;
//                            default: require("views/Ticket/RegistroTicket.php");
//                                break;
//                        }
                    ?>
            </section>
        </div>
        <footer>
            <div id="footer"><br>
                <h1 id="author">DESARROLLADO POR: <a target="_blank" href=#>ZEMA</a></h1>
            </div>
        </footer>
    </body>
</html>